package com.yzr.common.collection.set;

import java.util.TreeSet;

/**
 * @description
 * @author: yx-0173
 * @date: 2021-08-11 14:44
 **/
public class TreeSetConnect {
    public static void main(String[] args) {
        TreeSet<String> treeSet = new TreeSet<>((k, v) -> k.length());
        treeSet.add("jack");
        treeSet.add("tom");
        treeSet.add("smith");
        treeSet.add("sun");

        System.out.println(treeSet);

    }
}
